

//
//  ZFankuiViewController.m
//  ZQLearn
//
//  Created by macfeel on 2019/4/21.
//  Copyright © 2019 macfeel. All rights reserved.
//

#import "ZFankuiViewController.h"
#import "UITextView+PlaceHolder.h"
#import "SHAddImgView.h"
@interface ZFankuiViewController ()<SHAddImgViewDelegate>
@property (weak, nonatomic) IBOutlet UIView *bgView;

@property (weak, nonatomic) IBOutlet UITextView *textView;

@property (weak, nonatomic) IBOutlet UIButton *commitBtn;

@property (nonatomic,strong)SHAddImgView *addImgView;


@end

@implementation ZFankuiViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.navigationItem setItemWithTitle:@"意见反馈" textColor:kNavigationTitleColor fontSize:18 itemType:center];
    self.textView.placeholder = @"请留下您的意见和建议";
    self.commitBtn.layer.cornerRadius = 5.f;
    self.commitBtn.layer.masksToBounds = YES;
    self.commitBtn.backgroundColor = ThemeBlue;
    
    [UserInfoSave shareInstance].isGeren == false;
    
    [self addPhotos];
    
    // Do any additional setup after loading the view from its nib.
}

-(void)addPhotos{
    
    ///添加照片选择区域
    
    SHAddImgView *addImgView = [[SHAddImgView alloc] initWithMaxColumn:4];
    addImgView.frame = CGRectMake(0, 200, ScreenWidth, 185);
    addImgView.configModel = [SHConfigModel creatNormalConfig];
    addImgView.backgroundColor = kWhiteColor;
    addImgView.delegate = self;
    addImgView.ImgBlock = ^(NSArray *photos) {
        YYLog(@"%@",photos);
        //            self.photos = photos;
    };
    _addImgView = addImgView;
    [self.view addSubview:_addImgView];
    
    
}

- (IBAction)commitBtnAction:(UIButton *)sender {
    if (self.textView.text.length<1) {
        [AFToast showText:@"请输入意见反馈"];
        return;
    }
    [SVProgressHUD show];
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [AFToast showText:@"提交成功"];
        [self.navigationController popViewControllerAnimated:YES];
        [SVProgressHUD dismiss];
        
    });
    
}


/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
